package com.angel.service.ServiceImpl;

import com.angel.bean.ResourceCombination;
import com.angel.mapper.ResourceCombinationDao;
import com.angel.service.ResourceCombinationService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ResourceCombinationServiceImpl implements ResourceCombinationService {

    @Resource
    private ResourceCombinationDao resourceCombinationDao;

    @Override
    public int insert(ResourceCombination resourceCombination) {
        return resourceCombinationDao.insert(resourceCombination);
    }

    @Override
    public int insertSelective(ResourceCombination resourceCombination) {
        return resourceCombinationDao.insertSelective(resourceCombination);
    }

    @Override
    public int insertList(List<ResourceCombination> resourceCombinations) {
        return resourceCombinationDao.insertList(resourceCombinations);
    }

    @Override
    public int update(ResourceCombination resourceCombination) {
        return resourceCombinationDao.update(resourceCombination);
    }

    @Override
    public List<ResourceCombination> findAll(ResourceCombination resourceCombination) {
        return resourceCombinationDao.findAll(resourceCombination);
    }

    @Override
    public int delete(ResourceCombination resourceCombination) {
        return resourceCombinationDao.delete(resourceCombination);
    }

    @Override
    public ResourceCombination findOne(ResourceCombination resourceCombination) {
        List<ResourceCombination> list = this.findAll(resourceCombination);
        if (list == null || list.isEmpty()) {
            return null;
        }
        return list.get(0);
    }

    @Override
    public List<ResourceCombination> search(ResourceCombination resourceCombination) {
        return resourceCombinationDao.search(resourceCombination);
    }

    @Override
    public List<ResourceCombination> findAllStrat1Yes(ResourceCombination resourceCombination) {
        return resourceCombinationDao.findAllStrat1Yes(resourceCombination);
    }

    @Override
    public List<ResourceCombination> findAllStrat1No(ResourceCombination resourceCombination) {
        return resourceCombinationDao.findAllStrat1No(resourceCombination);
    }
}
